﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "ISurface.h"

namespace gcmp
{
    class Coordinate3d;
    class ICurve2d;
    class INurbsSurface;
    /// \brief 圆环面
    class ITorusSurface : public ISurface
    {
        DEFINE_CAST_DERIVED(gcmp::ITorusSurface, gcmp::ISurface);

    public:
        /// \brief  创建圆环面
        /// \param[in] coord 圆环面的局部坐标系，旋转轴对应 Z 轴正向，曲线的 y 向对应 Z 轴正向，曲线的 z 向对应旋转轨迹切线方向
        /// \param[in] rangeV V向参数域 V的最小值大于等于0.0，V的最大值小于等于2PI*radius 
        /// \param[in] pCurve2d 二维曲线
        /// \param[in] radius 旋转半径
        /// \param[in] isClockwise 是否是顺时针
        /// \return  圆环面
        GCMP_GEOMETRY_INTERFACE_EXPORT static OwnerPtr<ITorusSurface> Create(
            const gcmp::Coordinate3d& coord,
            const gcmp::Intervald& rangeV,
            const gcmp::ICurve2d* pCurve2d,
            double radius,
            bool isClockwise
        );

        /// \brief  获取坐标系
        virtual gcmp::Coordinate3d GetCoordinate()const = 0;

        /// \brief  获取旋转半径
        virtual double GetRadius()const = 0;

        /// \brief  获取二维曲线
        virtual OwnerPtr<ICurve2d> GetCurve2d()const = 0;       
    public:
        virtual ~ITorusSurface() = default;
    };
}
